7fa0964ee4ea7893c0b79b0ef09f639e083edf2c,framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java,PrimaryKeyFinder,runFind,#ModelEntity#Map#Delegator#boolean#boolean#Map#List#,101
Before Change
// need the timeZone and locale for conversion, so add here and remove after
entityContext.put("locale", context.get("locale"));
entityContext.put("timeZone", context.get("timeZone"));
modelEntity.convertFieldMapInPlace(entityContext, delegator);
entityContext.remove("locale");
entityContext.remove("timeZone");
After Change
}
}
public static GenericValue runFind(ModelEntity modelEntity, Map<String, Object> context, Delegator delegator, boolean useCache, boolean autoFieldMap,
Map<FlexibleMapAccessor<Object>, Object> fieldMap, List<FlexibleStringExpander> selectFieldExpanderList) throws GeneralException {
// assemble the field map
Map<String, Object> entityContext = FastMap.newInstance();
if (autoFieldMap) {
GenericValue tempVal = delegator.makeValue(modelEntity.getEntityName());
// try a map called "parameters", try it first so values from here are overridden by values in the main context
Object parametersObj = context.get("parameters");
if (parametersObj != null && parametersObj instanceof Map<?, ?>) {
Map<String, Object> parameters = UtilMisc.<String, Object>toMap(UtilGenerics.checkMap(parametersObj));
// need the timeZone and locale for conversion, so add here and remove after
parameters.put("locale", context.get("locale"));
parameters.put("timeZone", context.get("timeZone"));
modelEntity.convertFieldMapInPlace(parameters, delegator);
parameters.remove("timeZone");
parameters.remove("locale");
tempVal.setAllFields(parameters, true, null, Boolean.TRUE);
}
// just get the primary keys, and hopefully will get all of them, if not they must be manually filled in below in the field-maps
modelEntity.convertFieldMapInPlace(context, delegator);
tempVal.setAllFields(context, true, null, Boolean.TRUE);
entityContext.putAll(tempVal);